package com.zhenyi.xiaohuoche.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;
import com.utils.AuthUtils;

public class XHCAdminInterceptor implements Interceptor {

	@Override
	public void intercept(Invocation inv) {
		Controller controller = inv.getController();
		String uid = AuthUtils.getTokenUid(controller);
		if (!"CHUCHU".equals(uid)) {
			controller.redirect("/xhc/web/auth");
			return;
		}
		inv.invoke();
	}

}
